# Copyright (c) 2012 MaxMedia and Travis Warlick
# Licensed under the MIT License (see LICENSE)

module Dionysus
  module ForwardableToClass
    include Forwardable

    def def_instance_delegator_to_class(method, ali=method)
      def_instance_delegator "self.class", method, ali
    end
    alias_method :def_delegator_to_class, :def_instance_delegator_to_class

    def def_instance_delegators_to_class(*methods)
      for method in methods
        def_instance_delegator_to_class(method)
      end
    end
    alias_method :def_delegators_to_class, :def_instance_delegators_to_class
    alias_method :instance_delegate_to_class, :def_instance_delegators_to_class
    alias_method :delegate_to_class, :def_instance_delegators_to_class
  end
end
